<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <div id="app">

    <select multiple v-model="fruits">
      <option v-for="item in allFruits"
      :key="item.value"
      :value="item.value">
      {{ item.text }}
    </option>
    </select>

    <h2>多选：{{ fruits }}</h2>

   

  </div>
  
  <script src="../lib/vue.js"></script>
  <script>
    const app = Vue.createApp({
      data() {
        return {
          allFruits: [
            { value: "apple", text: "苹果" },
            { value: "orange", text: "橘子" },
            { value: "banana", text: "香蕉" },
          ],
          fruits: [],
        }
      }
    })
    app.mount("#app")
  </script>
</body>
</html>